package com.guang.elegantshutdowm.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestOneController {

    private static final Logger log = LoggerFactory.getLogger(TestOneController.class);

/*    @GetMapping(value = "/test")
    public String test(){
        log.info("test --- start");
        try {
            Thread.sleep(100000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        log.info("test --- end");
        return "test";
    }*/



    // @RequestMapping(value = "/test",method = RequestMethod.GET)
    @GetMapping(value = "/test")
    public String test(){
        System.out.println("test --- start");
        try {
            Thread.sleep(10000);
        } catch (InterruptedException e) {
            log.error("当前进程已被停止");
            e.printStackTrace();
        }
        System.out.println("test --- end");
        return "hello";
    }

}
